<template>
	<view>
		<view
			style="height: 50px; display: flex;flex-direction: row;justify-content: space-between;align-items: center; border-bottom: 1ppx solid #ddd;"
			v-for="(item,index) in record" :key="index">
			<view style="width: 100%; display: flex;flex-direction: column;">
				<text>{{item.type}}</text>
				<text>
					充值金额:{{item.money}}元
				</text>
			</view>
			<view class="">
				{{item.time}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				record: []
			}
		},
		methods: {
			getrecord(id) {
				uni.request({
					url: this.api.recordFindByUserId,
					method: 'GET',
					data: {
						userId: id
					},
					success: res => {
						if (res.data.code == 200) {
							this.record = res.data.obj
						}
					},
					fail: () => {},
					complete: () => {}
				});
			}
		},
		onLoad() {
			if (uni.getStorageSync('token')) {
				let user = uni.getStorageSync('token')
				this.getrecord(user.userId)
			}
		}
	}
</script>

<style>

</style>
